package com.project.entity.activity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.project.entity.BaseEntity;
import com.project.entity.enumcommon.AuditStatusEnum;

@Entity
@Table(name="B_ACTIVITY_LOG")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@DynamicInsert
@DynamicUpdate
public class ActivityLog extends BaseEntity{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5742088868018678190L;

	@Column(name="activity_id")
	private Long activityId;//活动id
	
	@Column(name="activity_user_id")
	private Long activityUserId;//活动用户id
	
	@Column(name="content")
	private String content;//内容
	
	@Column(name="status")
	@Enumerated(EnumType.STRING)
	private AuditStatusEnum status;//审核状态（W:报名了;P:已通过;N:未通过;C:取消了）
	
	@Column(name="create_user")
	private String createUser;//创建人
	
	@Column(name="create_time")
	private Date createTime;//创建时间
	
	@Column(name="update_time")
	private Date updateTime;//修改时间
	
	@OneToOne(fetch=FetchType.LAZY,cascade=CascadeType.REFRESH)
	@JoinColumn(name="activity_user_id",updatable=false,insertable=false)
	private ActivityUser activityUser;
	
	@OneToOne(fetch=FetchType.LAZY,cascade=CascadeType.REFRESH)
	@JoinColumn(name="activity_id",updatable=false,insertable=false)
	private Activity activity;

	public Long getActivityId() {
		return activityId;
	}

	public void setActivityId(Long activityId) {
		this.activityId = activityId;
	}

	public Long getActivityUserId() {
		return activityUserId;
	}

	public void setActivityUserId(Long activityUserId) {
		this.activityUserId = activityUserId;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public AuditStatusEnum getStatus() {
		return status;
	}

	public void setStatus(AuditStatusEnum status) {
		this.status = status;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public ActivityUser getActivityUser() {
		return activityUser;
	}

	public void setActivityUser(ActivityUser activityUser) {
		this.activityUser = activityUser;
	}

	public Activity getActivity() {
		return activity;
	}

	public void setActivity(Activity activity) {
		this.activity = activity;
	}	
}
